Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add MLflow logger #87

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Add MLflow logger #87

wants to merge 2 commits into from

Conversation

Youho99
Copy link

@Youho99 Youho99 commented Feb 26, 2024

Related to the issue #44

Add MLflow logger and a start of loggers documentation

Add logger documentation
Copy link

@AlieNiT AlieNiT left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great improvement. I've made a quick&dirty integration with mlflow in yolov7 repo yolov7-mlflowed but this one looks a lot cleaner.

@nikiniki1
Copy link

Hi! Could you provide some examples how to use mlflow logging? Readme description doesn't help me.
I launch server using mlflow server --backend-store-uri mlflow_server. As a train script using train_dual.py and at the top I import mflow, set mlflow.set_registry_uri(uri = 'http://127.0.0.1:5000'), and set
experiment_id = mlflow.create_experiment(
"test",
artifact_location=Path.cwd().joinpath("mlruns").as_uri(),
tags={"version": "v1", "priority": "P1"},
)
but I don't see anything in the web UI. Probably I'm wrong somewhere

@Youho99
Copy link
Author

Youho99 commented Mar 16, 2024

@nikiniki1
As explained in the README, you only have to define the different environment variables (MLFLOW_TRACKING_URI, MLFLOW_EXPERIMENT_NAME, MLFLOW_RUN) before launching your script. Tracking will then be done automatically. You don't need to import mlflow, this will also be done automatically.

More information on MLflow environment variables available: https://mlflow.org/docs/latest/python_api/mlflow.environment_variables.html

Currently, it is not possible to directly record tags using environment variables. This could be an interesting feature to add (on the mlflow github directly)

Don't hesitate to tell me if it works for you.

@nikiniki1
Copy link

@Youho99
So, I set these env variables and get message WARNING mlflow.utils.autologging_utils: You are using an unsupported version of pytorch. If you encounter errors during autologging, try upgrading / downgrading pytorch to a supported version, or try upgrading MLflow. I found my new experiment and run, but when I click 'model metrics' I didn't see anything. Torch=2.2.1, mlflow = 2.11.1

@Youho99
Copy link
Author

Youho99 commented Mar 22, 2024

@nikiniki1
The warning is normal

The logging seems to work correctly since the run is created, but the tracking of metrics poses a problem...

Open an issue on my fork, so that we can discuss it more deeply and find the solution to your problem.

@Timmy0618
Copy link

Timmy0618 commented Jun 7, 2024

@nikiniki1 As explained in the README, you only have to define the different environment variables (MLFLOW_TRACKING_URI, MLFLOW_EXPERIMENT_NAME, MLFLOW_RUN) before launching your script. Tracking will then be done automatically. You don't need to import mlflow, this will also be done automatically.

More information on MLflow environment variables available: https://mlflow.org/docs/latest/python_api/mlflow.environment_variables.html

Currently, it is not possible to directly record tags using environment variables. This could be an interesting feature to add (on the mlflow github directly)

Don't hesitate to tell me if it works for you.

Hi! I use docker create mlflow web server
and then i change the mlflow/init.py line 30 to uri = os.environ.get("MLFLOW_TRACKING_URI", "http://localhost:5000/")
but it seems nothing happened in my mlflow web UI
is that the right way to use ? thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants